package be.fedict.eid.diagnostics.system;

import be.fedict.eid.diagnostics.system.windows.WindowsSystemStrategy;

public class OperatingSystem implements OperatingSystemStrategy {

	private OperatingSystemStrategy strategy = null;	
	
	public OperatingSystem() throws OSException {
		String osName = System.getProperty("os.name");
        if (osName.startsWith("Windows"))
        	strategy = new WindowsSystemStrategy();
        //else if (osName.startsWith("Mac"))
        	//strategy = new MacSystemStrategy();
        else {
        	System.out.println("Not implemented.");
        	throw new OSException(osName + " not implemented yet.");
        }
        	
	}

	@Override
	public DeviceManager getDeviceManager() {
		return strategy.getDeviceManager();
	}

	@Override
	public ServiceManager getServiceManager() {
		return strategy.getServiceManager();
	}

	@Override
	public ProcessManager getProcessManager() {
		return strategy.getProcessManager();
	}
	
	@Override
	public PCSCManager getPCSCManager() {
		return strategy.getPCSCManager();
	}
	
	public String getName() {
    	return System.getProperty("os.name");
    }
    
    public String getVersion() {
    	return System.getProperty("os.version");
    }
    
    public String getArchitecture() {
    	return System.getProperty("os.arch");
    }
	
}
